package com.trg.designmodel.flyweight;

/**
 * @ClassName: Client
 * @Description:
 * @Author: tangrg
 * @Date: 2021/7/8 11:49
 * @Version: 1.0
 * @Return:
 **/
public class Client {

    public static void main(String[] args) {

        WebSiteFactory factory = new WebSiteFactory();
        WebSite concreteWebSite = factory.getWebSite("博客");
        concreteWebSite.use(new User("TOM"));

        WebSite concreteWebSite1 = factory.getWebSite("博客");
        concreteWebSite1.use(new User("Jerry"));

        WebSite concreteWebSite2 = factory.getWebSite("新闻");
        concreteWebSite2.use(new User("smith"));

        System.out.println("当前池子中总共有几个类型：" + factory.getSize());

    }
}
